﻿// open new window
function AnhXuanOpenNewWindow(link)
{
    var winSize = ",width=" + (screen.availWidth).toString() + ",height=" + (screen.availHeight).toString();

    var ControlBar="fullscreen=no,menubar=no, toolbar=no, scrollbars=yes,top=0,left=0, titlebar=no, resizable=yes,status=no,location=no ";
    window.open(link,'',ControlBar+winSize);
}
function AnhXuanOpenSetSize(link,width,height)
{
    var winSize = ",width=" + width.toString() + ",height=" + height.toString();

    var ControlBar="fullscreen=no,menubar=no, toolbar=no, scrollbars=yes,top=0,left=0, titlebar=no, resizable=yes,status=no,location=no ";
    window.open(link,'',ControlBar+winSize);
}
function toggleDisplay(blockId, titleId)
{
    
	var block = document.getElementById(blockId);
	var title = document.getElementById(titleId);
	if (block.className.indexOf("qsfNone") == -1)
	{
		block.className = block.className + " qsfNone";
		title.className = "qsfSubtitleCollapsed";
	}
	else
	{
		block.className = block.className.replace(/qsfNone/, "");
		title.className = "qsfSubtitle";
	}
	
	return false;
	 
}
function toggleListLab(blockId, titleId)
{
    
	var block = document.getElementById(blockId);
	var title = document.getElementById(titleId);
	if (block.className.indexOf("qsfNone") == -1)
	{
		block.className = "qsfNone";
		title.className = "qsfSubtitleCollapsed";
	}
	else
	{
		block.className = block.className.replace(/qsfNone/, "");
		title.className = "qsfSubtitle";
	}	
	return false;
	 
}
function labListToShowAll(hiddenContainsListId)
{
    var lstId=document.getElementById(hiddenContainsListId);
    var arrId=lstId.value.split(';');    
    for(i=0;i<arrId.length;i++)
    {
        var divToShow=document.getElementById(arrId[i]);
        divToShow.className="";        
    }  
}
function labListToHidewAll(hiddenContainsListId)
{
    var lstId=document.getElementById(hiddenContainsListId);
    var arrId=lstId.value.split(';');    
    for(i=0;i<arrId.length;i++)
    {
        var divToShow=document.getElementById(arrId[i]);
        divToShow.className="qsfNone";        
    }
   
    
}
function ptnShowPopupLabDetail(LabId)
{
    AnhXuanOpenSetSize("../QuanLyPTN/dhu_PTN_PhieuThongTinChung.aspx?_myId="+LabId.toString(),750,768);
}
function OnClientFileSelected(radUpload, eventArgs)
{                                   
    var Picture=document.getElementById('previewPicture');
    var fileInputs = $find("<%= rulAnhHinhAnh.ClientID %>").getFileInputs();
    var url=fileInputs[0].value;
    Picture.src=url;                                   
}
function OpenImageFullSize(ImageUrl)
{
   
    AnhXuanOpenSetSize("Popup.aspx?_PageId=1&_cPage=openImage&_urlImage="+ImageUrl,650,650);
}
